#include <iostream>
using namespace std;

int main()
{
    int row = 1;
    int n = 9;
    int col = 1;
    char flag[3] = " \n";
    while (row <= n)
    {
        cout << row << " * " << col << " = " << row * col << " " << flag[col / row];
        int temp = col % row + 1; 
        row = col / row + row;   
        col = temp;               
    }
    return 0;
}
